<?php
	$fn = 'mconfig.php';
	$file = fopen($fn,"r") or die('cannot open '.$fn);

	//error_reporting(0);// turn off errors on release
    $settings = parse_ini_file('troll.ini',true);
    require 'includes/dbconnect.php';
    require 'includes/functions.php';

    $aline = '';
    $id = 1;
	while (!feof($file))
	{	
		while(substr($aline,0,5) != 'Level')
			$aline = fgets($file);

		$level= explode(':', $aline);
		$level = $level[1];
		$aline = fgets($file);

		while (substr($aline,0,5) != 'Level' && $level < 13)
		{
		
			$mob = explode(';',$aline);
			$name = $mob[0];
			$str=$mob[1];
			$gp = $mob[2];
			$weapon = $mob[3];
			$xp = $mob[4];
			$hp = $mob[5];
			$death=$mob[6];

			try{
			$sql = "INSERT INTO creature (id, name, strength, gold, weaponName, xpForKill, hp, deathStr, level) VALUES (:id, :name, :str, :gp, :weapon, :xp, :hp, :death, :level)";
			$query = $db->prepare($sql);
			$query->bindParam(':id', $id);
			$query->bindParam(':name', $name);
			$query->bindParam(':str', $str);
			$query->bindParam(':gp', $gp);
			$query->bindParam(':weapon', $weapon);
			$query->bindParam(':xp', $xp);
			$query->bindParam(':hp', $hp);
			$query->bindParam(':death', $death);
			$query->bindParam(':level', $level);
			$query->execute();	
			$id ++;	
		} catch(PDOException $e) {

		echo $e->getMessage().'<br/>';// comment this out on release
		die('Having techical difficulties.Please check back later');

		}
			$aline = fgets($file);
		}
	}

?>
done...